import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/admin/info',
    method: 'get',
    params: {
      token
    }
  })
}

export function userList(params) {
  return request({
    url: '/user/user',
    method: 'get',
    params
  })
}


export function addUser(data) {
  return request({
    url: '/user/user',
    method: 'post',
    data
  })
}

export function delUser(data) {
  return request({
    url: '/user/user',
    method: 'delete',
    data
  })
}

export function updateUser(data) {
  return request({
    url: '/user/user',
    method: 'put',
    data
  })
}

export function searchUser(params) {
  return request({
    url: '/user/search',
    method: 'get',
    params
  })
}

export function getUserinfo(params) {
  return request({
    url: '/user/userinfo',
    method: 'get',
    params
  })
}
